package com.xja.mapper;

import com.xja.pojo.Admin;
import com.xja.pojo.AdminExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AdminMapper {

    @Select("select * from admins where loginname=#{loginName}")
    Admin selectAdminByLoginName(@Param("loginName") String loginName);

    @Select("select p.permissionurl from admins a left join admin_role ar on(a.id=ar.admins) \n" +
            "\t\tleft join role_permission ap on(ar.roles=ap.roles) \n" +
            "\t\tleft join permissions p on (ap.permissions=p.id) where a.id=#{id}")
    List<String> selectAdminPermissionById(Integer id);

    int countByExample(AdminExample example);

    int deleteByExample(AdminExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Admin record);

    int insertSelective(Admin record);

    List<Admin> selectByExample(AdminExample example);

    Admin selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    int updateByPrimaryKeySelective(Admin record);

    int updateByPrimaryKey(Admin record);
}